<?php

namespace app\admin\controller;

use think\Request;

class Site extends Common
{
    protected function initialize()
    {
        parent::initialize();
        $this->m = new \app\admin\model\Site();   //别名：避免与控制名冲突
    }

    public function index()
    {
        $site=$this->m->find();
        $this->assign('site',$site);
        return $this->fetch();
    }

    public function edit($id)
    {
        $this->m=$this->m->find($id);
        $res=$this->m->save($this->request->post());
        if($res){
            return xjson();
        }else{
            return xjson(404);
        }

    }


}
